import { ChatUser } from "@/types/chat-message";
// WebRTC 信令类型枚举
export const SignalType = {
  NO_START: -3, // 未开始
  SUCCESS: -2,
  FAILED: -1,
  REJECT: 0,
  OFFER: 1,
  ANSWER: 2,
  CANDIDATE: 3,
  DISCONNECT: 4,
} as const;

export type SignalType = (typeof SignalType)[keyof typeof SignalType];

/**
 * WebRTC 信令消息请求和响应类型定义
 */
export interface SignalMessageRequest {
  type: SignalType; // "offer", "answer", "candidate"
  user: ChatUser; // 发送者信息
  receiver: string; // 接收者ID
  payload?: any; // 负载信息
}

/**
 * WebRTC 信令消息响应类型定义
 */
export interface SignalMessageResponse {
  type: SignalType; // "offer", "answer", "candidate"
  user?: ChatUser; // 发送者信息
  payload?: any; // 负载信息
  tip: string; // 对于失败或拒绝类型的提示信息
}